//统一管理用户相关的接口
import request from "@/utils/request";

//统一管理接口
enum API {
    RolePage_URL = "/itp/api/role",
    RoleMenu_URL = "/itp/api/roleMenu",
} 

export default {
    getRoleList: (current: number, size: number, data: any) => request.post(`${API.RolePage_URL}/page?current=${current}&size=${size}`, data),
    getRoleDetail: (id: number) => request.get(`${API.RolePage_URL}/id?id=${id}`),
    roleDelete: (id: number) => request.delete(`${API.RolePage_URL}?id=${id}`),
    roleAdd: (param: any) => request.post(`${API.RolePage_URL}`,param),
    roleUpdate: (param: any) => request.put(`${API.RolePage_URL}`,param),
    roleSelect: (param: string) => request.get(`${API.RolePage_URL}/select?searchKey=${param}`),

    getRoleMenu: (param: any) => request.get(`${API.RoleMenu_URL}/bind${param}`),
    bindRoleMenu: (param: any) => request.put(`${API.RoleMenu_URL}/bind`,param),
    updateBatchRoleMenu: (param: any) => request.put(`${API.RoleMenu_URL}/batch`,param),
}
